
<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>1. Introduction &#8212; onusim  documentation</title>
    <link rel="stylesheet" href="../_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../_static/extra.css" />
    <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script src="../_static/jquery.js"></script>
    <script src="../_static/underscore.js"></script>
    <script src="../_static/doctools.js"></script>
    <script src="../_static/language_data.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="2. Extensions" href="extensions.html" />
    <link rel="prev" title="ONU simulator and test client" href="../index.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="extensions.html" title="2. Extensions"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="../index.html" title="ONU simulator and test client"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">onusim  documentation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href=""><span class="section-number">1. </span>Introduction</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="introduction">
<h1><span class="section-number">1. </span>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h1>
<div class="section" id="installation">
<h2><span class="section-number">1.1. </span>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h2>
<p>The ONU simulator currently lives in the <a class="reference external" href="https://code.broadband-forum.org/projects/OBBAA/repos/obbaa-polt-simulator/browse">obbaa-polt-simulator</a> Bitbucket repository (it will be in the <code class="docutils literal notranslate"><span class="pre">develop</span></code> branch, but at the time of writing is only in the <code class="docutils literal notranslate"><span class="pre">feature/OBBAA-237-william-onu-simulator-toplevel</span></code> branch). It lives in the <code class="docutils literal notranslate"><span class="pre">tr451_vomci_onu</span></code> subdirectory.</p>
<p>Having checked out the repository and gone to <code class="docutils literal notranslate"><span class="pre">tr451_vomci_onu</span></code>, you have two options:</p>
<ol class="simple">
<li><p>Set <code class="docutils literal notranslate"><span class="pre">PYTHONPATH</span></code> and <code class="docutils literal notranslate"><span class="pre">PATH</span></code> manually. For example:</p></li>
</ol>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>% export PYTHONPATH=$PWD
% export PATH=$PATH:$PWD/bin
</pre></div>
</div>
<ol class="simple" start="2">
<li><p>Install the <code class="docutils literal notranslate"><span class="pre">obbaa-onusim</span></code> python package (this assumes that the necessary python tools are installed; note that you need python3, and that I&rsquo;ve been using python3.6):</p></li>
</ol>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">pip3</span> <span class="n">install</span> <span class="o">--</span><span class="n">upgrade</span> <span class="o">.</span>
</pre></div>
</div>
<p>Or you can run in Docker. See <a class="reference external" href="#docker">Docker</a> below.</p>
</div>
<div class="section" id="onu-simulation-server">
<h2><span class="section-number">1.2. </span>ONU simulation server<a class="headerlink" href="#onu-simulation-server" title="Permalink to this headline">¶</a></h2>
<p>The <a class="reference internal" href="../bin/index.html#module-bin.onusim" title="bin.onusim">ONU simulation server</a> is an OMCI server that simulates one or

more ONUs on a single channel termination. It currently supports the following
<a class="reference internal" href="../obbaa_onusim/index.html#obbaa_onusim.mib.MIB" title="obbaa_onusim.mib.MIB">MIB</a>s and <a class="reference internal" href="../obbaa_onusim/index.html#obbaa_onusim.action.Action" title="obbaa_onusim.action.Action">action</a>s:</p>
<ul class="simple">
<li><p><a class="reference internal" href="../obbaa_onusim/index.html#obbaa_onusim.mibs.onu_g.onu_g_mib" title="obbaa_onusim.mibs.onu_g.onu_g_mib">ONU-G</a> : <a class="reference internal" href="../obbaa_onusim/index.html#module-obbaa_onusim.actions.get" title="obbaa_onusim.actions.get">Get</a>, <a class="reference internal" href="../obbaa_onusim/index.html#module-obbaa_onusim.actions.set" title="obbaa_onusim.actions.set">Set</a></p></li>
<li><p><a class="reference internal" href="../obbaa_onusim/index.html#obbaa_onusim.mibs.onu2_g.onu2_g_mib" title="obbaa_onusim.mibs.onu2_g.onu2_g_mib">ONU2-G</a> : <a class="reference internal" href="../obbaa_onusim/index.html#module-obbaa_onusim.actions.get" title="obbaa_onusim.actions.get">Get</a>, <a class="reference internal" href="../obbaa_onusim/index.html#module-obbaa_onusim.actions.set" title="obbaa_onusim.actions.set">Set</a></p></li>
<li><p><a class="reference internal" href="../obbaa_onusim/index.html#obbaa_onusim.mibs.onu_data.onu_data_mib" title="obbaa_onusim.mibs.onu_data.onu_data_mib">ONU data</a> : <a class="reference internal" href="../obbaa_onusim/index.html#module-obbaa_onusim.actions.get" title="obbaa_onusim.actions.get">Get</a>, <a class="reference internal" href="../obbaa_onusim/index.html#module-obbaa_onusim.actions.set" title="obbaa_onusim.actions.set">Set</a>, <a class="reference internal" href="../obbaa_onusim/index.html#module-obbaa_onusim.actions.reset" title="obbaa_onusim.actions.reset">MIB reset</a>, <a class="reference internal" href="../obbaa_onusim/index.html#module-obbaa_onusim.actions.upload" title="obbaa_onusim.actions.upload">MIB upload</a>, <a class="reference internal" href="../obbaa_onusim/index.html#module-obbaa_onusim.actions.upload" title="obbaa_onusim.actions.upload">MIB upload next</a></p></li>
<li><p><a class="reference internal" href="../obbaa_onusim/index.html#obbaa_onusim.mibs.software_image.software_image_mib" title="obbaa_onusim.mibs.software_image.software_image_mib">Software image</a> : <a class="reference internal" href="../obbaa_onusim/index.html#module-obbaa_onusim.actions.get" title="obbaa_onusim.actions.get">Get</a>, <a class="reference internal" href="../obbaa_onusim/index.html#module-obbaa_onusim.actions.set" title="obbaa_onusim.actions.set">Set</a></p></li>
</ul>
<p>The server doesn&rsquo;t yet support events (notifications).</p>
<p>When the server starts up, it populates its <a class="reference internal" href="../obbaa_onusim/index.html#module-obbaa_onusim.database" title="obbaa_onusim.database">database</a> with (currently) the following <a class="reference internal" href="../obbaa_onusim/index.html#obbaa_onusim.mib.MIB" title="obbaa_onusim.mib.MIB">MIB</a> instances:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">(</span>
    <span class="p">(</span><span class="n">ONU_G_mib</span><span class="p">,</span> <span class="p">(</span>
        <span class="p">{</span><span class="s1">&#39;me_inst&#39;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="s1">&#39;vendor_id&#39;</span><span class="p">:</span> <span class="mi">1234</span><span class="p">,</span> <span class="s1">&#39;version&#39;</span><span class="p">:</span> <span class="s1">&#39;v2&#39;</span><span class="p">,</span>
         <span class="s1">&#39;serial_number&#39;</span><span class="p">:</span> <span class="p">(</span><span class="s1">&#39;abcdefgh&#39;</span><span class="p">,</span> <span class="mi">5678</span><span class="p">)},</span>
    <span class="p">)),</span>
    <span class="p">(</span><span class="n">ONU2_G_mib</span><span class="p">,</span> <span class="p">(</span>
        <span class="p">{</span><span class="s1">&#39;me_inst&#39;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="s1">&#39;omcc_version&#39;</span><span class="p">:</span> <span class="n">omcc_version</span><span class="p">,</span>
         <span class="s1">&#39;sys_up_time&#39;</span><span class="p">:</span> <span class="k">lambda</span><span class="p">:</span> <span class="nb">int</span><span class="p">(</span><span class="mf">100.0</span> <span class="o">*</span> <span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">-</span> <span class="n">startup_time</span><span class="p">))},</span>
    <span class="p">)),</span>
    <span class="p">(</span><span class="n">ONU_DATA_mib</span><span class="p">,</span> <span class="p">(</span>
        <span class="p">{</span><span class="s1">&#39;me_inst&#39;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="s1">&#39;mib_data_sync&#39;</span><span class="p">:</span> <span class="mi">0</span><span class="p">},</span>
    <span class="p">)),</span>
    <span class="p">(</span><span class="n">SW_IMAGE_mib</span><span class="p">,</span> <span class="p">(</span>
        <span class="p">{</span><span class="s1">&#39;me_inst&#39;</span><span class="p">:</span> <span class="mh">0x0000</span><span class="p">},</span>
        <span class="p">{</span><span class="s1">&#39;me_inst&#39;</span><span class="p">:</span> <span class="mh">0x0001</span><span class="p">},</span>
        <span class="p">{</span><span class="s1">&#39;me_inst&#39;</span><span class="p">:</span> <span class="mh">0x0100</span><span class="p">},</span>
        <span class="p">{</span><span class="s1">&#39;me_inst&#39;</span><span class="p">:</span> <span class="mh">0x0101</span><span class="p">}</span>
    <span class="p">))</span>
<span class="p">)</span>
</pre></div>
</div>
<p>By default, only mandatory attributes are implemented. Attributes that aren&rsquo;t explicitly defined in the above data structure will have the default values from the MIB definitions. For example, this (from <a class="reference internal" href="../obbaa_onusim/index.html#obbaa_onusim.mibs.onu_g.onu_g_mib" title="obbaa_onusim.mibs.onu_g.onu_g_mib">here</a>) specifies that the ONU-G MIB&rsquo;s <code class="docutils literal notranslate"><span class="pre">version</span></code> attribute (attribute #2) is a 14-byte string with a default of <code class="docutils literal notranslate"><span class="pre">v1</span></code>.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Attr</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="s1">&#39;version&#39;</span><span class="p">,</span> <span class="s1">&#39;Version&#39;</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="n">M</span><span class="p">,</span> <span class="n">String</span><span class="p">(</span><span class="mi">14</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s1">&#39;v1&#39;</span><span class="p">)),</span>
</pre></div>
</div>
<p>By default, the server will report only warnings and errors. In this example, the logging level is set to 2 (debug) but you are more likely to want to use level 1 (info).</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">onusim</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">l</span> <span class="mi">2</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">args</span> <span class="n">Namespace</span><span class="p">(</span><span class="n">address</span><span class="o">=</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="n">ctermname</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span>
<span class="n">dumpfile</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">loglevel</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">onuidfirst</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">onuidlast</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">port</span><span class="o">=</span><span class="mi">12345</span><span class="p">)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">server</span> <span class="n">Endpoint</span><span class="p">(</span><span class="n">address</span><span class="o">=</span><span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">12345</span><span class="p">),</span> <span class="n">is_server</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span> <span class="n">onu_id_range</span><span class="o">=</span><span class="nb">range</span><span class="p">(</span><span class="mi">42</span><span class="p">,</span> <span class="mi">43</span><span class="p">),</span> <span class="n">tr451</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dumpfd</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span>
</pre></div>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">onusim</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">l</span> <span class="mi">1</span>
<span class="o">&lt;</span><span class="n">there</span><span class="s1">&#39;s no level 1 output on startup&gt;</span>
</pre></div>
</div>
</div>
<div class="section" id="onu-test-client">
<h2><span class="section-number">1.3. </span>ONU test client<a class="headerlink" href="#onu-test-client" title="Permalink to this headline">¶</a></h2>
<p>The <a class="reference internal" href="../bin/index.html#module-bin.onucli" title="bin.onucli">ONU test client</a> is a simple command-line utility that (currently) just sends commands to a server and waits for a response.</p>
<p>For example (assuming that the server is running) this is what a baseline get looks like on the client (which defaults to logging level 1):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">onucli</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">h</span>
<span class="n">usage</span><span class="p">:</span> <span class="n">onucli</span> <span class="p">[</span><span class="o">-</span><span class="n">h</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">a</span> <span class="n">ADDRESS</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">p</span> <span class="n">PORT</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">n</span> <span class="n">CTERMNAME</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">i</span> <span class="n">ONUIDFIRST</span><span class="p">]</span>
              <span class="p">[</span><span class="o">-</span><span class="n">I</span> <span class="n">ONUIDLAST</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">e</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">d</span> <span class="p">[</span><span class="n">DUMPFILE</span><span class="p">]]</span> <span class="p">[</span><span class="o">-</span><span class="n">l</span> <span class="n">LOGLEVEL</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">t</span> <span class="n">TCI</span><span class="p">]</span>
              <span class="p">{</span><span class="nb">set</span><span class="p">,</span><span class="n">get</span><span class="p">,</span><span class="n">reset</span><span class="p">,</span><span class="n">upload</span><span class="p">,</span><span class="n">upload</span><span class="o">-</span><span class="nb">next</span><span class="p">}</span> <span class="o">...</span>

<span class="p">[</span><span class="o">...</span><span class="p">]</span>

<span class="n">positional</span> <span class="n">arguments</span><span class="p">:</span>
  <span class="p">{</span><span class="nb">set</span><span class="p">,</span><span class="n">get</span><span class="p">,</span><span class="n">reset</span><span class="p">,</span><span class="n">upload</span><span class="p">,</span><span class="n">upload</span><span class="o">-</span><span class="nb">next</span><span class="p">}</span>
    <span class="nb">set</span>                 <span class="n">Set</span> <span class="n">MIB</span> <span class="n">instance</span> <span class="n">attribute</span> <span class="n">values</span><span class="o">.</span> <span class="n">Supply</span> <span class="n">the</span> <span class="n">values</span>
                        <span class="k">as</span> <span class="n">one</span> <span class="ow">or</span> <span class="n">more</span> <span class="n">name</span><span class="o">=</span><span class="n">value</span> <span class="n">pairs</span><span class="p">,</span> <span class="n">where</span> <span class="n">name</span> <span class="ow">is</span> <span class="n">the</span>
                        <span class="n">attribute</span> <span class="n">name</span> <span class="ow">or</span> <span class="n">number</span><span class="o">.</span>
    <span class="n">get</span>                 <span class="n">Get</span> <span class="n">MIB</span> <span class="n">instance</span> <span class="n">attribute</span> <span class="n">values</span><span class="o">.</span>
    <span class="n">reset</span>               <span class="n">Reset</span> <span class="n">MIB</span> <span class="n">instance</span> <span class="n">values</span><span class="o">.</span>
    <span class="n">upload</span>              <span class="n">Prepare</span> <span class="k">for</span> <span class="n">upload</span> <span class="n">of</span> <span class="n">MIB</span> <span class="n">instance</span> <span class="n">values</span><span class="o">.</span> <span class="n">The</span> <span class="n">MIB</span>
                        <span class="n">instance</span> <span class="n">values</span> <span class="n">are</span> <span class="n">latched</span> <span class="ow">and</span> <span class="n">will</span> <span class="n">remain</span> <span class="n">valid</span> <span class="k">for</span>
                        <span class="mi">60</span> <span class="n">seconds</span><span class="o">.</span> <span class="n">The</span> <span class="n">returned</span> <span class="n">num_upload_nexts</span> <span class="n">value</span> <span class="ow">is</span>
                        <span class="n">the</span> <span class="n">number</span> <span class="n">of</span> <span class="n">upload</span><span class="o">-</span><span class="nb">next</span> <span class="n">invocations</span> <span class="n">needed</span> <span class="n">to</span>
                        <span class="k">return</span> <span class="n">them</span>
    <span class="n">upload</span><span class="o">-</span><span class="nb">next</span>         <span class="n">Upload</span> <span class="n">the</span> <span class="nb">next</span> <span class="nb">set</span> <span class="n">of</span> <span class="n">MIB</span> <span class="n">instance</span> <span class="n">values</span><span class="o">.</span> <span class="n">The</span>
                        <span class="n">supplied</span> <span class="n">sequence</span> <span class="n">number</span> <span class="n">must</span> <span class="n">be</span> <span class="ow">in</span> <span class="n">the</span> <span class="nb">range</span> <span class="mi">0</span> <span class="n">to</span>
                        <span class="n">num_upload_nexts</span> <span class="o">-</span> <span class="mf">1.</span> <span class="n">If</span> <span class="n">upload</span> <span class="n">hasn</span><span class="s1">&#39;t been called,</span>
                        <span class="ow">or</span> <span class="n">was</span> <span class="n">called</span> <span class="n">more</span> <span class="n">than</span> <span class="mi">60</span> <span class="n">seconds</span> <span class="n">ago</span><span class="p">,</span> <span class="n">no</span> <span class="n">data</span> <span class="n">will</span>
                        <span class="n">be</span> <span class="n">returned</span><span class="o">.</span>

<span class="n">optional</span> <span class="n">arguments</span><span class="p">:</span>
  <span class="o">-</span><span class="n">h</span><span class="p">,</span> <span class="o">--</span><span class="n">help</span>            <span class="n">show</span> <span class="n">this</span> <span class="n">help</span> <span class="n">message</span> <span class="ow">and</span> <span class="n">exit</span>
  <span class="o">-</span><span class="n">a</span> <span class="n">ADDRESS</span><span class="p">,</span> <span class="o">--</span><span class="n">address</span> <span class="n">ADDRESS</span>
                        <span class="n">server</span> <span class="n">DNS</span> <span class="n">name</span> <span class="ow">or</span> <span class="n">IP</span> <span class="n">address</span><span class="p">;</span> <span class="n">default</span><span class="p">:</span> <span class="s1">&#39;127.0.0.1&#39;</span>
  <span class="o">-</span><span class="n">p</span> <span class="n">PORT</span><span class="p">,</span> <span class="o">--</span><span class="n">port</span> <span class="n">PORT</span>  <span class="n">server</span> <span class="n">UDP</span> <span class="n">port</span> <span class="n">number</span><span class="p">;</span> <span class="n">default</span><span class="p">:</span> <span class="mi">12345</span>
  <span class="o">-</span><span class="n">n</span> <span class="n">CTERMNAME</span><span class="p">,</span> <span class="o">--</span><span class="n">ctermname</span> <span class="n">CTERMNAME</span>
                        <span class="n">channel</span> <span class="n">termination</span> <span class="n">name</span><span class="p">;</span> <span class="n">default</span><span class="p">:</span> <span class="s1">&#39;cterm&#39;</span>
  <span class="o">-</span><span class="n">i</span> <span class="n">ONUIDFIRST</span><span class="p">,</span> <span class="o">--</span><span class="n">onuidfirst</span> <span class="n">ONUIDFIRST</span>
                        <span class="n">first</span> <span class="n">ONU</span> <span class="nb">id</span><span class="p">;</span> <span class="n">default</span><span class="p">:</span> <span class="mi">42</span>
  <span class="o">-</span><span class="n">I</span> <span class="n">ONUIDLAST</span><span class="p">,</span> <span class="o">--</span><span class="n">onuidlast</span> <span class="n">ONUIDLAST</span>
                        <span class="n">last</span> <span class="n">ONU</span> <span class="nb">id</span><span class="p">;</span> <span class="n">default</span><span class="p">:</span> <span class="n">same</span> <span class="k">as</span> <span class="n">first</span>
  <span class="o">-</span><span class="n">e</span><span class="p">,</span> <span class="o">--</span><span class="n">extended</span>        <span class="n">whether</span> <span class="n">to</span> <span class="n">use</span><span class="o">/</span><span class="n">support</span> <span class="n">extended</span> <span class="n">messages</span>
  <span class="o">-</span><span class="n">d</span> <span class="p">[</span><span class="n">DUMPFILE</span><span class="p">],</span> <span class="o">--</span><span class="n">dumpfile</span> <span class="p">[</span><span class="n">DUMPFILE</span><span class="p">]</span>
                        <span class="n">file</span> <span class="n">to</span> <span class="n">which</span> <span class="n">to</span> <span class="n">dump</span> <span class="nb">hex</span> <span class="n">messages</span><span class="p">;</span> <span class="n">default</span> <span class="p">(</span><span class="k">if</span> <span class="n">value</span>
                        <span class="n">omitted</span><span class="p">):</span> <span class="s1">&#39;dump.txt&#39;</span>
  <span class="o">-</span><span class="n">l</span> <span class="n">LOGLEVEL</span><span class="p">,</span> <span class="o">--</span><span class="n">loglevel</span> <span class="n">LOGLEVEL</span>
                        <span class="n">logging</span> <span class="n">level</span> <span class="p">(</span><span class="mi">0</span><span class="o">=</span><span class="n">errors</span><span class="o">+</span><span class="n">warnings</span><span class="p">,</span> <span class="mi">1</span><span class="o">=</span><span class="n">info</span><span class="p">,</span> <span class="mi">2</span><span class="o">=</span><span class="n">debug</span><span class="p">);</span>
                        <span class="n">default</span><span class="p">:</span> <span class="mi">1</span>
  <span class="o">-</span><span class="n">t</span> <span class="n">TCI</span><span class="p">,</span> <span class="o">--</span><span class="n">tci</span> <span class="n">TCI</span>     <span class="n">first</span> <span class="n">TCI</span> <span class="p">(</span><span class="n">Transaction</span> <span class="n">Correlation</span> <span class="n">Identifier</span><span class="p">);</span>
                        <span class="n">default</span><span class="p">:</span> <span class="mi">0</span>
</pre></div>
</div>
</div>
<div class="section" id="examples">
<h2><span class="section-number">1.4. </span>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="section" id="get">
<h3>Get<a class="headerlink" href="#get" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">onucli</span><span class="o">.</span><span class="n">py</span> <span class="n">get</span> <span class="o">-</span><span class="n">h</span>
<span class="n">usage</span><span class="p">:</span> <span class="n">onucli</span> <span class="n">get</span> <span class="p">[</span><span class="o">-</span><span class="n">h</span><span class="p">]</span> <span class="p">[</span><span class="n">me_class</span><span class="p">]</span> <span class="p">[</span><span class="n">me_inst</span><span class="p">]</span> <span class="p">[</span><span class="n">attr_mask</span><span class="p">]</span>

<span class="n">positional</span> <span class="n">arguments</span><span class="p">:</span>
  <span class="n">me_class</span>    <span class="n">ME</span> <span class="n">class</span><span class="p">;</span> <span class="n">default</span><span class="p">:</span> <span class="mi">256</span>
  <span class="n">me_inst</span>     <span class="n">ME</span> <span class="n">instance</span><span class="p">;</span> <span class="n">default</span><span class="p">:</span> <span class="mi">0</span>
  <span class="n">attr_mask</span>   <span class="n">ME</span> <span class="n">instance</span><span class="p">;</span> <span class="n">default</span><span class="p">:</span> <span class="mi">65535</span>

<span class="n">optional</span> <span class="n">arguments</span><span class="p">:</span>
<span class="o">-</span><span class="n">h</span><span class="p">,</span> <span class="o">--</span><span class="n">help</span>  <span class="n">show</span> <span class="n">this</span> <span class="n">help</span> <span class="n">message</span> <span class="ow">and</span> <span class="n">exit</span>
</pre></div>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">onucli</span><span class="o">.</span><span class="n">py</span> <span class="n">get</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onucli</span><span class="p">:</span><span class="n">sent</span> <span class="n">message</span> <span class="n">Get</span><span class="p">(</span><span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xffff</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span>
<span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="n">to</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span>
<span class="mi">12345</span><span class="p">)</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onucli</span><span class="p">:</span><span class="n">received</span> <span class="n">response</span> <span class="n">GetResponse</span><span class="p">(</span><span class="n">admin_state</span><span class="o">=</span><span class="s1">&#39;unlock&#39;</span><span class="p">,</span>
<span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xd600</span><span class="p">,</span> <span class="n">battery_backup</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">opt_attr_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">opt_exec_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span>
<span class="n">reason</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">traffic_management</span><span class="o">=</span><span class="s1">&#39;priority-controlled&#39;</span><span class="p">,</span> <span class="n">vendor_id</span><span class="o">=</span><span class="mi">1234</span><span class="p">,</span>
<span class="n">version</span><span class="o">=</span><span class="s1">&#39;v2&#39;</span><span class="p">)</span> <span class="kn">from</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">50654</span><span class="p">)</span>
</pre></div>
</div>
<p>The server output is very similar (assuming that it&rsquo;s running at logging level

1) but is of course from its point of view:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">received</span> <span class="n">message</span> <span class="n">Get</span><span class="p">(</span><span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xffff</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span>
<span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="kn">from</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span>
<span class="mi">52959</span><span class="p">)</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">sent</span> <span class="n">response</span> <span class="n">GetResponse</span><span class="p">(</span><span class="n">attr_exec_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xd600</span><span class="p">,</span>
<span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span>
<span class="n">opt_attr_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">reason</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="n">to</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">52959</span><span class="p">)</span>
</pre></div>
</div>
<p>What&rsquo;s going on here? Note that <code class="docutils literal notranslate"><span class="pre">reason=3</span></code> (Parameter error). Why? Ah, it must be because we&rsquo;re using baseline messages and there isn&rsquo;t room for all the requested attributes! Try running the server with logging level 2:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">onusim</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">l</span> <span class="mi">2</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">args</span> <span class="n">Namespace</span><span class="p">(</span><span class="n">address</span><span class="o">=</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="n">ctermname</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span> <span class="n">dumpfile</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">loglevel</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">onuidfirst</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">onuidlast</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">12345</span><span class="p">)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">server</span> <span class="n">Endpoint</span><span class="p">(</span><span class="n">address</span><span class="o">=</span><span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">12345</span><span class="p">),</span> <span class="n">is_server</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span>
<span class="n">onu_id_range</span><span class="o">=</span><span class="nb">range</span><span class="p">(</span><span class="mi">42</span><span class="p">,</span> <span class="mi">43</span><span class="p">),</span> <span class="n">tr451</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dumpfd</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">endpoint</span><span class="p">:</span><span class="n">received</span> <span class="mi">76</span><span class="o">/</span><span class="mi">2048</span> <span class="nb">bytes</span> <span class="kn">from</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">55688</span><span class="p">)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">endpoint</span><span class="p">:</span><span class="mi">637465726</span><span class="n">d0000000000000000000000000000000000000000000000</span>
<span class="mi">0000002</span><span class="n">a0000490a01000000ffff00000000000000000000000000000000000000000000000000</span>
<span class="mi">000000000000000028</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">received</span> <span class="n">message</span> <span class="n">Get</span><span class="p">(</span><span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xffff</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="kn">from</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">60241</span><span class="p">)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">get</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xffff</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">instance</span> <span class="p">{</span><span class="s1">&#39;me_inst&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">0</span><span class="p">,),</span> <span class="s1">&#39;vendor_id&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">1234</span><span class="p">,),</span> <span class="s1">&#39;version&#39;</span><span class="p">:</span> <span class="p">(</span><span class="s1">&#39;v2&#39;</span><span class="p">,),</span>
<span class="s1">&#39;serial_number&#39;</span><span class="p">:</span> <span class="p">(</span><span class="s1">&#39;abcdefgh&#39;</span><span class="p">,</span> <span class="mi">5678</span><span class="p">),</span> <span class="s1">&#39;traffic_management&#39;</span><span class="p">:</span> <span class="p">(</span><span class="s1">&#39;priority-controlled&#39;</span><span class="p">,),</span>
<span class="s1">&#39;battery_backup&#39;</span><span class="p">:</span> <span class="p">(</span><span class="kc">False</span><span class="p">,),</span> <span class="s1">&#39;admin_state&#39;</span><span class="p">:</span> <span class="p">(</span><span class="s1">&#39;unlock&#39;</span><span class="p">,)}</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 1(vendor_id) = (1234,)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 2(version) = (&#39;v2&#39;,)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 3(serial_number) ignored (too long for baseline message)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 4(traffic_management) = (&#39;priority-controlled&#39;,)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 5 not found</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 6(battery_backup) = (False,)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 7(admin_state) = (&#39;unlock&#39;,)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 8(oper_state) ignored (not implemented)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 9(survival_time) ignored (not implemented)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 10(logical_onu_id) ignored (not implemented)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 11(logical_password) ignored (not implemented)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 12(credentials_status) ignored (not implemented)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 13(extended_tc_options) ignored (not implemented)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 14 not found</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 15 not found</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 16 not found</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">endpoint</span><span class="p">:</span><span class="n">sent</span> <span class="mi">76</span> <span class="nb">bytes</span> <span class="n">to</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">60241</span><span class="p">)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">endpoint</span><span class="p">:</span><span class="mi">637465726</span><span class="n">d0000000000000000000000000000000000000000000000</span>
<span class="mi">0000002</span><span class="n">a0000290a0100000003d600000004d27632000000000000000000000000000000000000</span>
<span class="mi">000000000000000028</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">sent</span> <span class="n">response</span> <span class="n">GetResponse</span><span class="p">(</span><span class="n">attr_exec_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xd600</span><span class="p">,</span>
<span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span>
<span class="n">opt_attr_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">reason</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="n">to</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">55688</span><span class="p">)</span>
</pre></div>
</div>
<p>You can see that options 1, 2, 4, 6 and 7 were included, but option 3 is too long and was ignored.</p>
</div>
<div class="section" id="omci_dump_decoder">
<h3>omci_dump_decoder<a class="headerlink" href="#omci_dump_decoder" title="Permalink to this headline">¶</a></h3>
<p>The Broadcom <code class="docutils literal notranslate"><span class="pre">omci_dump_decoder</span></code> utility is attached to <a class="reference external" href="https://issues.broadband-forum.org/browse/OBBAA-237">OBBAA-237</a> and is included in the Docker image.</p>
<p>You can use the client or server <code class="docutils literal notranslate"><span class="pre">-d</span></code> or <code class="docutils literal notranslate"><span class="pre">--dumpfile</span></code> option to save a Hex dump of all the messages (the TR-451 <code class="docutils literal notranslate"><span class="pre">(cterm_name,</span> <span class="pre">onu_id)</span></code> header is not included). This can then be passed to <code class="docutils literal notranslate"><span class="pre">omci_dump_decoder</span></code>.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">root</span><span class="o">@</span><span class="mi">24</span><span class="n">ae9dfa1989</span><span class="p">:</span><span class="o">/</span><span class="c1"># onucli.py -d dump.txt get</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onucli</span><span class="p">:</span><span class="n">sent</span> <span class="n">message</span> <span class="n">Get</span><span class="p">(</span><span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xffff</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="n">to</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">12345</span><span class="p">)</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onucli</span><span class="p">:</span><span class="n">received</span> <span class="n">response</span> <span class="n">GetResponse</span><span class="p">(</span><span class="n">admin_state</span><span class="o">=</span><span class="s1">&#39;unlock&#39;</span><span class="p">,</span> <span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xd600</span><span class="p">,</span> <span class="n">battery_backup</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">opt_attr_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">opt_exec_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">reason</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">traffic_management</span><span class="o">=</span><span class="s1">&#39;priority-controlled&#39;</span><span class="p">,</span> <span class="n">vendor_id</span><span class="o">=</span><span class="mi">1234</span><span class="p">,</span> <span class="n">version</span><span class="o">=</span><span class="s1">&#39;v2&#39;</span><span class="p">)</span> <span class="kn">from</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">12345</span><span class="p">)</span>

<span class="n">root</span><span class="o">@</span><span class="mi">24</span><span class="n">ae9dfa1989</span><span class="p">:</span><span class="o">/</span><span class="c1"># cat dump.txt</span>
<span class="c1"># TCI  MT DI CLS  INST CONTENTS                                                         TRAILER</span>
  <span class="mi">0000</span> <span class="mi">49</span> <span class="mi">0</span><span class="n">a</span> <span class="mi">0100</span> <span class="mi">0000</span> <span class="n">ffff000000000000000000000000000000000000000000000000000000000000</span> <span class="mi">00000028</span>
<span class="c1"># TCI  MT DI CLS  INST CONTENTS                                                         TRAILER</span>
  <span class="mi">0000</span> <span class="mi">29</span> <span class="mi">0</span><span class="n">a</span> <span class="mi">0100</span> <span class="mi">0000</span> <span class="mi">03</span><span class="n">d600000004d276320000000000000000000000000000000000000000000000</span> <span class="mi">00000028</span>

<span class="n">root</span><span class="o">@</span><span class="mi">24</span><span class="n">ae9dfa1989</span><span class="p">:</span><span class="o">/</span><span class="c1"># omci_dump_decoder dump.txt</span>
<span class="p">[</span><span class="mi">2541645</span><span class="p">:</span> <span class="n">I</span> <span class="n">default</span>             <span class="p">]</span> <span class="n">bcm_dev_log_task</span><span class="o">.</span><span class="n">c</span> <span class="mi">1458</span><span class="o">|</span> <span class="n">Logging</span> <span class="n">started</span>
<span class="p">[</span><span class="mi">2541645</span><span class="p">:</span> <span class="n">I</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_api</span><span class="o">.</span><span class="n">c</span> <span class="mi">121</span><span class="o">|</span> <span class="n">Using</span> <span class="n">Broadcom</span> <span class="n">OMCI</span> <span class="n">Stack</span>
<span class="p">[</span><span class="mi">2541646</span><span class="p">:</span> <span class="n">I</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_dump_decoder</span><span class="o">.</span><span class="n">c</span> <span class="mi">210</span><span class="o">|</span> <span class="mi">1</span>      <span class="c1"># TCI  MT DI CLS  INST CONTENTS                                                         TRAILER</span>
<span class="p">[</span><span class="mi">2541646</span><span class="p">:</span> <span class="n">I</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_dump_decoder</span><span class="o">.</span><span class="n">c</span> <span class="mi">210</span><span class="o">|</span> <span class="mi">2</span>        <span class="mi">0000</span> <span class="mi">49</span> <span class="mi">0</span><span class="n">a</span> <span class="mi">0100</span> <span class="mi">0000</span> <span class="n">ffff000000000000000000000000000000000000000000000000000000000000</span> <span class="mi">00000028</span>
<span class="p">[</span><span class="mi">2541646</span><span class="p">:</span> <span class="n">I</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_dump_decoder</span><span class="o">.</span><span class="n">c</span> <span class="mi">273</span><span class="o">|</span> <span class="o">&gt;&gt;&gt;</span> <span class="n">AR</span><span class="o">=</span><span class="mi">1</span> <span class="n">AK</span><span class="o">=</span><span class="mi">0</span> <span class="n">TCI</span><span class="o">=</span><span class="mi">0</span> <span class="n">class</span><span class="o">=</span><span class="mi">256</span><span class="p">(</span><span class="mh">0x100</span><span class="p">)</span> <span class="n">entity_id</span><span class="o">=</span><span class="mi">0</span>
<span class="p">[</span><span class="mi">2541646</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8829</span><span class="o">|</span> <span class="p">{</span><span class="n">olt</span><span class="o">=</span><span class="mi">0</span> <span class="n">pon_if</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">cookie</span><span class="o">=</span><span class="mi">0</span><span class="p">}:</span> <span class="n">Dump</span> <span class="n">ME</span><span class="p">:</span> <span class="n">onu_g</span> <span class="p">(</span><span class="mi">256</span><span class="p">),</span> <span class="n">Entity</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="n">Action</span><span class="p">:</span> <span class="n">GET</span> <span class="p">[</span>
<span class="p">[</span><span class="mi">2541646</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8835</span><span class="o">|</span>    <span class="n">vendor_id</span><span class="p">:</span>  <span class="mi">0</span>
<span class="p">[</span><span class="mi">2541646</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8837</span><span class="o">|</span>    <span class="n">version</span><span class="p">:</span>    <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span>
<span class="p">[</span><span class="mi">2541646</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8839</span><span class="o">|</span>    <span class="n">serial_number</span><span class="p">:</span>  <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span>
<span class="p">[</span><span class="mi">2541646</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8841</span><span class="o">|</span>    <span class="n">traffic_management</span><span class="p">:</span> <span class="mi">0</span>
<span class="p">[</span><span class="mi">2541646</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8843</span><span class="o">|</span>    <span class="n">deprecated0</span><span class="p">:</span>    <span class="mi">0</span>
<span class="p">[</span><span class="mi">2541646</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8845</span><span class="o">|</span>    <span class="n">battery_backup</span><span class="p">:</span> <span class="mi">0</span>
<span class="p">[</span><span class="mi">2541646</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8847</span><span class="o">|</span>    <span class="n">admin_state</span><span class="p">:</span>    <span class="mi">0</span>
<span class="p">[</span><span class="mi">2541646</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8849</span><span class="o">|</span>    <span class="n">oper_state</span><span class="p">:</span> <span class="mi">0</span>
<span class="p">[</span><span class="mi">2541646</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8851</span><span class="o">|</span>    <span class="n">survival_time</span><span class="p">:</span>  <span class="mi">0</span>
<span class="p">[</span><span class="mi">2541646</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8853</span><span class="o">|</span>    <span class="n">logical_onu_id</span><span class="p">:</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span>
<span class="p">[</span><span class="mi">2541647</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8855</span><span class="o">|</span>    <span class="n">logical_password</span><span class="p">:</span>   <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span>
<span class="p">[</span><span class="mi">2541647</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8857</span><span class="o">|</span>    <span class="n">credentials_status</span><span class="p">:</span> <span class="mi">0</span>
<span class="p">[</span><span class="mi">2541647</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8859</span><span class="o">|</span>    <span class="n">extended_tc_options</span><span class="p">:</span>    <span class="mh">0x0</span>
<span class="p">[</span><span class="mi">2541647</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8862</span><span class="o">|</span> <span class="p">]</span>
<span class="p">[</span><span class="mi">2541647</span><span class="p">:</span> <span class="n">I</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_dump_decoder</span><span class="o">.</span><span class="n">c</span> <span class="mi">210</span><span class="o">|</span> <span class="mi">3</span>      <span class="c1"># TCI  MT DI CLS  INST CONTENTS                                                         TRAILER</span>
<span class="p">[</span><span class="mi">2541647</span><span class="p">:</span> <span class="n">I</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_dump_decoder</span><span class="o">.</span><span class="n">c</span> <span class="mi">210</span><span class="o">|</span> <span class="mi">4</span>        <span class="mi">0000</span> <span class="mi">29</span> <span class="mi">0</span><span class="n">a</span> <span class="mi">0100</span> <span class="mi">0000</span> <span class="mi">03</span><span class="n">d600000004d276320000000000000000000000000000000000000000000000</span> <span class="mi">00000028</span>
<span class="p">[</span><span class="mi">2541647</span><span class="p">:</span> <span class="n">I</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_dump_decoder</span><span class="o">.</span><span class="n">c</span> <span class="mi">251</span><span class="o">|</span> <span class="o">&lt;&lt;&lt;</span> <span class="n">AR</span><span class="o">=</span><span class="mi">0</span> <span class="n">AK</span><span class="o">=</span><span class="mi">1</span> <span class="n">TCI</span><span class="o">=</span><span class="mi">0</span> <span class="n">class</span><span class="o">=</span><span class="mi">256</span><span class="p">(</span><span class="mh">0x100</span><span class="p">)</span> <span class="n">entity_id</span><span class="o">=</span><span class="mi">0</span> <span class="n">result</span><span class="o">=</span><span class="mi">3</span>
<span class="p">[</span><span class="mi">2541647</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8829</span><span class="o">|</span> <span class="p">{</span><span class="n">olt</span><span class="o">=</span><span class="mi">0</span> <span class="n">pon_if</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">cookie</span><span class="o">=</span><span class="mi">0</span><span class="p">}:</span> <span class="n">Dump</span> <span class="n">ME</span><span class="p">:</span> <span class="n">onu_g</span> <span class="p">(</span><span class="mi">256</span><span class="p">),</span> <span class="n">Entity</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="n">Action</span><span class="p">:</span> <span class="n">GET</span> <span class="p">[</span>
<span class="p">[</span><span class="mi">2541647</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8835</span><span class="o">|</span>    <span class="n">vendor_id</span><span class="p">:</span>  <span class="mi">1234</span>
<span class="p">[</span><span class="mi">2541647</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8837</span><span class="o">|</span>    <span class="n">version</span><span class="p">:</span>    <span class="mi">76</span> <span class="mi">32</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span>
<span class="p">[</span><span class="mi">2541647</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8841</span><span class="o">|</span>    <span class="n">traffic_management</span><span class="p">:</span> <span class="mi">0</span>
<span class="p">[</span><span class="mi">2541647</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8845</span><span class="o">|</span>    <span class="n">battery_backup</span><span class="p">:</span> <span class="mi">0</span>
<span class="p">[</span><span class="mi">2541647</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8847</span><span class="o">|</span>    <span class="n">admin_state</span><span class="p">:</span>    <span class="mi">0</span>
<span class="p">[</span><span class="mi">2541647</span><span class="p">:</span> <span class="n">D</span> <span class="n">OMCI_ME_LAYER</span>       <span class="p">]</span> <span class="n">omci_stack_enc_dec</span><span class="o">.</span><span class="n">c</span> <span class="mi">8862</span><span class="o">|</span> <span class="p">]</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="docker">
<h2><span class="section-number">1.5. </span>Docker<a class="headerlink" href="#docker" title="Permalink to this headline">¶</a></h2>
<p>I&rsquo;ve created an <code class="docutils literal notranslate"><span class="pre">obbaa-onu-simulator</span></code> Docker image. The image includes the ONU simulation servertest client and documentation.</p>
<p><strong>Note: The image is no longer based on the <code class="docutils literal notranslate"><span class="pre">obbaa-polt-simulator</span></code> image. It&rsquo;s

  therefore necessary to run the pOLT simulator in a different container.</strong></p>
<p>The scripts are installed using the usual python mechanisms, so it&rsquo;s not necessary to set <code class="docutils literal notranslate"><span class="pre">PYTHONPATH</span></code> or <code class="docutils literal notranslate"><span class="pre">PATH</span></code>. The documentation is in <code class="docutils literal notranslate"><span class="pre">/opt/obbaa-onu-simulator/docs/html</span></code>.</p>
<p>Docker networking features are host-dependent, and I&rsquo;ve only tested this on a Mac (<a class="reference external" href="https://docs.docker.com/docker-for-mac/networking">Networking features in Docker Desktop for Mac</a>).</p>
<div class="section" id="docker-server-host-client">
<h3>Docker server, host client<a class="headerlink" href="#docker-server-host-client" title="Permalink to this headline">¶</a></h3>
<p><strong>Docker server</strong></p>
<p>For incoming traffic, the Docker container has to expose a port. This could be configured in the image.</p>
<p>With this command, on a Mac UDP traffic to <code class="docutils literal notranslate"><span class="pre">127.0.0.1:12345</span></code> will be sent to the Docker container and will be received by a server listening on <code class="docutils literal notranslate"><span class="pre">0.0.0.0:12345</span></code>.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">docker</span> <span class="n">container</span> <span class="n">run</span> <span class="o">-</span><span class="n">it</span> <span class="o">--</span><span class="n">name</span> <span class="n">obbaa</span><span class="o">-</span><span class="n">onu</span><span class="o">-</span><span class="n">simulator</span> <span class="o">--</span><span class="n">rm</span> \
         <span class="o">-</span><span class="n">p</span> <span class="mi">12345</span><span class="p">:</span><span class="mi">12345</span><span class="o">/</span><span class="n">udp</span> <span class="n">broadbandforum</span><span class="o">/</span><span class="n">obbaa</span><span class="o">-</span><span class="n">onu</span><span class="o">-</span><span class="n">simulator</span><span class="p">:</span><span class="n">latest</span> <span class="n">bash</span>

<span class="n">root</span><span class="nd">@c1c6d167bee2</span><span class="p">:</span><span class="o">/</span><span class="c1"># onusim.py -l 1</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">received</span> <span class="n">message</span> <span class="n">Get</span><span class="p">(</span><span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xffff</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span>
<span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="kn">from</span> <span class="p">(</span><span class="s1">&#39;172.17.0.1&#39;</span><span class="p">,</span>
<span class="mi">46917</span><span class="p">)</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">sent</span> <span class="n">response</span> <span class="n">GetResponse</span><span class="p">(</span><span class="n">attr_exec_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xd600</span><span class="p">,</span>
<span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span>
<span class="n">opt_attr_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">reason</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="n">to</span> <span class="p">(</span><span class="s1">&#39;172.17.0.1&#39;</span><span class="p">,</span> <span class="mi">46917</span><span class="p">)</span>
</pre></div>
</div>
<p><strong>Host client</strong></p>
<p>Default options work fine on the host.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">onucli</span><span class="o">.</span><span class="n">py</span> <span class="n">get</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onucli</span><span class="p">:</span><span class="n">sent</span> <span class="n">message</span> <span class="n">Get</span><span class="p">(</span><span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xffff</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span>
<span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="n">to</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span>
<span class="mi">12345</span><span class="p">)</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onucli</span><span class="p">:</span><span class="n">received</span> <span class="n">response</span> <span class="n">GetResponse</span><span class="p">(</span><span class="n">admin_state</span><span class="o">=</span><span class="s1">&#39;unlock&#39;</span><span class="p">,</span>
<span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xd600</span><span class="p">,</span> <span class="n">battery_backup</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">opt_attr_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">opt_exec_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span>
<span class="n">reason</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">traffic_management</span><span class="o">=</span><span class="s1">&#39;priority-controlled&#39;</span><span class="p">,</span> <span class="n">vendor_id</span><span class="o">=</span><span class="mi">1234</span><span class="p">,</span>
<span class="n">version</span><span class="o">=</span><span class="s1">&#39;v2&#39;</span><span class="p">)</span> <span class="kn">from</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">12345</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="host-server-docker-client">
<h3>Host server, Docker client<a class="headerlink" href="#host-server-docker-client" title="Permalink to this headline">¶</a></h3>
<p><strong>Host server</strong></p>
<p>Default options work fine on the host.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">onusim</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">l</span> <span class="mi">1</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">received</span> <span class="n">message</span> <span class="n">Get</span><span class="p">(</span><span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xffff</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span>
<span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="kn">from</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span>
<span class="mi">58054</span><span class="p">)</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">sent</span> <span class="n">response</span> <span class="n">GetResponse</span><span class="p">(</span><span class="n">attr_exec_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xd600</span><span class="p">,</span>
<span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span>
<span class="n">opt_attr_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">reason</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="n">to</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">58054</span><span class="p">)</span>
</pre></div>
</div>
<p><strong>Docker client</strong></p>
<p>For outgoing traffic, no port needs to be exposed. The Docker container uses a special <code class="docutils literal notranslate"><span class="pre">host.docker.internal</span></code> DNS name to connect to a Mac host.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">docker</span> <span class="n">container</span> <span class="n">run</span> <span class="o">-</span><span class="n">it</span> <span class="o">--</span><span class="n">name</span> <span class="n">obbaa</span><span class="o">-</span><span class="n">onu</span><span class="o">-</span><span class="n">simulator</span> <span class="o">--</span><span class="n">rm</span> \
         <span class="n">broadbandforum</span><span class="o">/</span><span class="n">obbaa</span><span class="o">-</span><span class="n">onu</span><span class="o">-</span><span class="n">simulator</span><span class="p">:</span><span class="n">latest</span> <span class="n">bash</span>

<span class="n">root</span><span class="nd">@da41e01238b0</span><span class="p">:</span><span class="o">/</span><span class="c1"># onucli.py -a host.docker.internal get</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onucli</span><span class="p">:</span><span class="n">sent</span> <span class="n">message</span> <span class="n">Get</span><span class="p">(</span><span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xffff</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span>
<span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="n">to</span>
<span class="p">(</span><span class="s1">&#39;host.docker.internal&#39;</span><span class="p">,</span> <span class="mi">12345</span><span class="p">)</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onucli</span><span class="p">:</span><span class="n">received</span> <span class="n">response</span> <span class="n">GetResponse</span><span class="p">(</span><span class="n">admin_state</span><span class="o">=</span><span class="s1">&#39;unlock&#39;</span><span class="p">,</span>
<span class="n">attr_mask</span><span class="o">=</span><span class="mh">0xd600</span><span class="p">,</span> <span class="n">battery_backup</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;cterm&#39;</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">42</span><span class="p">,</span> <span class="n">opt_attr_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">opt_exec_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span>
<span class="n">reason</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">traffic_management</span><span class="o">=</span><span class="s1">&#39;priority-controlled&#39;</span><span class="p">,</span> <span class="n">vendor_id</span><span class="o">=</span><span class="mi">1234</span><span class="p">,</span>
<span class="n">version</span><span class="o">=</span><span class="s1">&#39;v2&#39;</span><span class="p">)</span> <span class="kn">from</span> <span class="p">(</span><span class="s1">&#39;192.168.65.2&#39;</span><span class="p">,</span> <span class="mi">12345</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="docker-server-docker-client">
<h3>Docker server, Docker client<a class="headerlink" href="#docker-server-docker-client" title="Permalink to this headline">¶</a></h3>
<p>Running the server and client in the same Docker container just works (even if the same port is exposed externally).</p>
<p>I haven&rsquo;t experimented with running the server and client in different Docker containers but I don&rsquo;t think it will be difficult.</p>
</div>
<div class="section" id="with-tr451_polt_simulator-new-using-docker-compose">
<h3>With tr451_polt_simulator: new (using docker-compose)<a class="headerlink" href="#with-tr451_polt_simulator-new-using-docker-compose" title="Permalink to this headline">¶</a></h3>
<p>With this <code class="docutils literal notranslate"><span class="pre">.env</span></code> file:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">COMPOSE_PROJECT_NAME</span><span class="o">=</span><span class="n">onusim</span>
</pre></div>
</div>
<p>And this <code class="docutils literal notranslate"><span class="pre">docker-compose.yaml</span></code> file:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">version</span><span class="p">:</span> <span class="s1">&#39;3&#39;</span>

<span class="n">services</span><span class="p">:</span>
  <span class="c1"># can use this with default options from the host</span>
  <span class="n">cterm</span><span class="p">:</span>
    <span class="n">image</span><span class="p">:</span> <span class="s1">&#39;broadbandforum/obbaa-onu-simulator:latest&#39;</span>
    <span class="n">ports</span><span class="p">:</span>
      <span class="o">-</span> <span class="s1">&#39;12345:12345/udp&#39;</span>
    <span class="n">command</span><span class="p">:</span> <span class="n">onusim</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">l</span> <span class="mi">1</span> <span class="o">-</span><span class="n">n</span> <span class="n">cterm</span> <span class="o">-</span><span class="n">i</span> <span class="mi">1</span> <span class="o">-</span><span class="n">I</span> <span class="mi">100</span>

  <span class="c1"># can use this with the options in Igor&#39;s example</span>
  <span class="n">cterm1</span><span class="p">:</span>
    <span class="n">image</span><span class="p">:</span> <span class="s1">&#39;broadbandforum/obbaa-onu-simulator:latest&#39;</span>
    <span class="n">ports</span><span class="p">:</span>
      <span class="o">-</span> <span class="s1">&#39;50001:50000/udp&#39;</span>
    <span class="n">command</span><span class="p">:</span> <span class="n">onusim</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">l</span> <span class="mi">2</span> <span class="o">-</span><span class="n">p</span> <span class="mi">50000</span> <span class="o">-</span><span class="n">n</span> <span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span> <span class="o">-</span><span class="n">i</span> <span class="mi">1</span> <span class="o">-</span><span class="n">I</span> <span class="mi">100</span>

  <span class="c1"># can use this with the options in Igor&#39;s example (but different chan term)</span>
  <span class="c1"># XXX temporarily use the same channel termination name</span>
  <span class="n">cterm2</span><span class="p">:</span>
    <span class="n">image</span><span class="p">:</span> <span class="s1">&#39;broadbandforum/obbaa-onu-simulator:latest&#39;</span>
    <span class="n">ports</span><span class="p">:</span>
      <span class="o">-</span> <span class="s1">&#39;50002:50000/udp&#39;</span>
    <span class="n">command</span><span class="p">:</span> <span class="n">onusim</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">l</span> <span class="mi">2</span> <span class="o">-</span><span class="n">p</span> <span class="mi">50000</span> <span class="o">-</span><span class="n">n</span> <span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span> <span class="o">-</span><span class="n">i</span> <span class="mi">1</span> <span class="o">-</span><span class="n">I</span> <span class="mi">100</span>

  <span class="n">polt</span><span class="p">:</span>
    <span class="n">depends_on</span><span class="p">:</span>
      <span class="o">-</span> <span class="n">cterm1</span>
    <span class="n">image</span><span class="p">:</span> <span class="s1">&#39;broadbandforum/obbaa-polt-simulator:latest&#39;</span>
    <span class="n">volumes</span><span class="p">:</span>
      <span class="o">-</span> <span class="s1">&#39;$APPROOT:/app&#39;</span>
    <span class="n">ports</span><span class="p">:</span>
      <span class="o">-</span> <span class="s1">&#39;8433:8433/tcp&#39;</span>
    <span class="n">stdin_open</span><span class="p">:</span> <span class="n">true</span>
    <span class="n">tty</span><span class="p">:</span> <span class="n">true</span>
    <span class="n">working_dir</span><span class="p">:</span> <span class="o">/</span><span class="n">opt</span><span class="o">/</span><span class="n">obbaa</span><span class="o">-</span><span class="n">polt</span><span class="o">-</span><span class="n">simulator</span><span class="o">/</span><span class="n">build</span><span class="o">/</span><span class="n">fs</span>
    <span class="c1"># XXX with gdb doesn&#39;t run; should use gdb -ex run option?</span>
    <span class="c1"># XXX can&#39;t set onu_sim_ip = cterm1; have to use IP address but what is it?</span>
    <span class="c1">#     (for now, hard-coded in /app/share/polt.cli)</span>
    <span class="n">command</span><span class="p">:</span> <span class="o">&gt;</span>
      <span class="n">bash</span> <span class="o">-</span><span class="n">c</span> <span class="s2">&quot;apt-get update</span>
      <span class="o">&amp;&amp;</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="o">--</span><span class="n">yes</span> <span class="n">install</span> <span class="n">valgrind</span>
      <span class="o">&amp;&amp;</span> <span class="o">./</span><span class="n">start_tr451_polt</span><span class="o">.</span><span class="n">sh</span> <span class="n">valgrind</span> <span class="o">-</span><span class="n">log</span> <span class="n">debug</span> <span class="o">-</span><span class="n">f</span> <span class="o">/</span><span class="n">app</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">polt</span><span class="o">.</span><span class="n">cli</span> <span class="o">-</span><span class="n">d</span><span class="s2">&quot;</span>

  <span class="n">vomci</span><span class="p">:</span>
    <span class="n">depends_on</span><span class="p">:</span>
      <span class="o">-</span> <span class="n">polt</span>
    <span class="n">image</span><span class="p">:</span> <span class="s1">&#39;broadbandforum/obbaa-polt-simulator:latest&#39;</span>
    <span class="n">volumes</span><span class="p">:</span>
      <span class="o">-</span> <span class="s1">&#39;$APPROOT:/app&#39;</span>
    <span class="n">stdin_open</span><span class="p">:</span> <span class="n">true</span>
    <span class="n">tty</span><span class="p">:</span> <span class="n">true</span>
    <span class="n">working_dir</span><span class="p">:</span> <span class="o">/</span><span class="n">opt</span><span class="o">/</span><span class="n">obbaa</span><span class="o">-</span><span class="n">polt</span><span class="o">-</span><span class="n">simulator</span><span class="o">/</span><span class="n">build</span><span class="o">/</span><span class="n">fs</span>
    <span class="n">command</span><span class="p">:</span> <span class="o">./</span><span class="n">start_tr451_polt</span><span class="o">.</span><span class="n">sh</span> <span class="o">-</span><span class="n">log</span> <span class="n">debug</span> <span class="o">-</span><span class="n">f</span> <span class="o">/</span><span class="n">app</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">vomci</span><span class="o">.</span><span class="n">cli</span> <span class="o">-</span><span class="n">d</span>

  <span class="c1"># after docker-compose up, do docker-compose ps to determine the vomci</span>
  <span class="c1"># container name (probably onusim_vomci_1) and then do docker attach &lt;name&gt;;</span>
  <span class="c1"># can then enter interactive commands</span>
  <span class="c1"># beware that ^C will terminate the container so do ^P^Q to detach</span>
</pre></div>
</div>
<p><strong>Start up services:</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">docker</span><span class="o">-</span><span class="n">compose</span> <span class="n">up</span>
<span class="n">Starting</span> <span class="n">onusim_cterm2_1</span> <span class="o">...</span> <span class="n">done</span>
<span class="n">Starting</span> <span class="n">onusim_cterm1_1</span> <span class="o">...</span> <span class="n">done</span>
<span class="n">Starting</span> <span class="n">onusim_cterm_1</span>  <span class="o">...</span> <span class="n">done</span>
<span class="n">Starting</span> <span class="n">onusim_polt_1</span>   <span class="o">...</span> <span class="n">done</span>
<span class="n">Starting</span> <span class="n">onusim_vomci_1</span>  <span class="o">...</span> <span class="n">done</span>
<span class="n">Attaching</span> <span class="n">to</span> <span class="n">onusim_cterm1_1</span><span class="p">,</span> <span class="n">onusim_cterm_1</span><span class="p">,</span> <span class="n">onusim_cterm2_1</span><span class="p">,</span> <span class="n">onusim_polt_1</span><span class="p">,</span> <span class="n">onusim_vomci_1</span>
<span class="n">cterm1_1</span>  <span class="o">|</span> <span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">args</span> <span class="n">Namespace</span><span class="p">(</span><span class="n">address</span><span class="o">=</span><span class="s1">&#39;0.0.0.0&#39;</span><span class="p">,</span> <span class="n">ctermname</span><span class="o">=</span><span class="s1">&#39;channeltermination.1&#39;</span><span class="p">,</span> <span class="n">dumpfile</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">loglevel</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">onuidfirst</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">onuidlast</span><span class="o">=</span><span class="mi">100</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">50000</span><span class="p">)</span>
<span class="o">...</span>
<span class="o">...</span>
<span class="n">polt_1</span>    <span class="o">|</span> <span class="p">[</span><span class="mi">1008214</span><span class="p">:</span> <span class="n">I</span> <span class="n">POLT</span>                <span class="p">]</span> <span class="n">bcm_tr451_polt_common</span><span class="o">.</span><span class="n">cc</span> <span class="mi">458</span><span class="o">|</span> <span class="n">ONU</span> <span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">1</span> <span class="ow">is</span> <span class="n">assigned</span> <span class="n">to</span> <span class="n">remote</span> <span class="n">endpoint</span> <span class="n">vomci1</span>
</pre></div>
</div>
<p><strong>Attach to vomci and inject commands:</strong></p>
<p>Determine container name:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">docker</span><span class="o">-</span><span class="n">compose</span> <span class="n">ps</span>
     <span class="n">Name</span>                    <span class="n">Command</span>               <span class="n">State</span>            <span class="n">Ports</span>
<span class="o">-----------------------------------------------------------------------------------</span>
<span class="n">onusim_cterm1_1</span>   <span class="n">onusim</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">l</span> <span class="mi">2</span> <span class="o">-</span><span class="n">p</span> <span class="mi">50000</span> <span class="o">-</span><span class="n">n</span> <span class="o">...</span>   <span class="n">Up</span>      <span class="mf">0.0</span><span class="o">.</span><span class="mf">0.0</span><span class="p">:</span><span class="mi">50001</span><span class="o">-&gt;</span><span class="mi">50000</span><span class="o">/</span><span class="n">udp</span>
<span class="n">onusim_cterm2_1</span>   <span class="n">onusim</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">l</span> <span class="mi">2</span> <span class="o">-</span><span class="n">p</span> <span class="mi">50000</span> <span class="o">-</span><span class="n">n</span> <span class="o">...</span>   <span class="n">Up</span>      <span class="mf">0.0</span><span class="o">.</span><span class="mf">0.0</span><span class="p">:</span><span class="mi">50002</span><span class="o">-&gt;</span><span class="mi">50000</span><span class="o">/</span><span class="n">udp</span>
<span class="n">onusim_cterm_1</span>    <span class="n">onusim</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">l</span> <span class="mi">1</span> <span class="o">-</span><span class="n">n</span> <span class="n">cterm</span> <span class="o">-</span><span class="n">i</span> <span class="o">...</span>   <span class="n">Up</span>      <span class="mf">0.0</span><span class="o">.</span><span class="mf">0.0</span><span class="p">:</span><span class="mi">12345</span><span class="o">-&gt;</span><span class="mi">12345</span><span class="o">/</span><span class="n">udp</span>
<span class="n">onusim_polt_1</span>     <span class="n">bash</span> <span class="o">-</span><span class="n">c</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">update</span> <span class="o">&amp;&amp;</span>  <span class="o">...</span>   <span class="n">Up</span>      <span class="mf">0.0</span><span class="o">.</span><span class="mf">0.0</span><span class="p">:</span><span class="mi">8433</span><span class="o">-&gt;</span><span class="mi">8433</span><span class="o">/</span><span class="n">tcp</span>
<span class="n">onusim_vomci_1</span>    <span class="o">./</span><span class="n">start_tr451_polt</span><span class="o">.</span><span class="n">sh</span> <span class="o">-</span><span class="n">log</span> <span class="o">...</span>   <span class="n">Up</span>
</pre></div>
</div>
<p>Attach:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">docker</span> <span class="n">attach</span> <span class="n">onusim_vomci_1</span>
</pre></div>
</div>
<p>Inject:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">/</span><span class="n">po</span><span class="o">/</span><span class="n">inject</span> <span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span> <span class="mi">1</span> <span class="mi">0054480</span><span class="n">a01000000040001000000000000000000000000000000000000000000000000000000000000000028</span>
</pre></div>
</div>
<p>Detach:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">^</span><span class="n">P</span><span class="o">^</span><span class="n">Q</span>
<span class="n">read</span> <span class="n">escape</span> <span class="n">sequence</span>
<span class="o">%</span>
</pre></div>
</div>
<p><strong>Output (in services window):</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">vomci_1</span>   <span class="o">|</span> <span class="o">/</span><span class="n">po</span><span class="o">/</span><span class="n">inject</span> <span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span> <span class="mi">1</span> <span class="mi">0054480</span><span class="n">a01000000040001000000000000000000000000000000000000000000000000000000000000000028</span>
<span class="n">vomci_1</span>   <span class="o">|</span> <span class="p">[</span><span class="mi">1390503</span><span class="p">:</span> <span class="n">D</span> <span class="n">POLT</span>                <span class="p">]</span> <span class="n">sim_tr451_polt_vendor</span><span class="o">.</span><span class="n">cc</span> <span class="mi">117</span><span class="o">|</span> <span class="n">RX</span> <span class="kn">from</span> <span class="nn">ONU</span><span class="p">:</span> <span class="n">cterm</span><span class="o">=</span><span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">1</span> <span class="n">length</span><span class="o">=</span><span class="mi">48</span> <span class="n">OMCI_HDR</span><span class="o">=</span><span class="mi">0054480</span><span class="n">a</span> <span class="mi">01000000</span>
<span class="n">polt_1</span>    <span class="o">|</span> <span class="p">[</span><span class="mi">1390559</span><span class="p">:</span> <span class="n">D</span> <span class="n">POLT</span>                <span class="p">]</span> <span class="n">sim_tr451_polt_vendor</span><span class="o">.</span><span class="n">cc</span> <span class="mi">191</span><span class="o">|</span> <span class="n">TX</span> <span class="n">to</span> <span class="n">ONU</span><span class="p">:</span> <span class="n">cterm</span><span class="o">=</span><span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">1</span> <span class="n">length</span><span class="o">=</span><span class="mi">48</span> <span class="n">OMCI_HDR</span><span class="o">=</span><span class="mi">0054480</span><span class="n">a</span> <span class="mi">01000000</span>
<span class="n">cterm2_1</span>  <span class="o">|</span> <span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">endpoint</span><span class="p">:</span><span class="n">received</span> <span class="mi">80</span><span class="o">/</span><span class="mi">2048</span> <span class="nb">bytes</span> <span class="kn">from</span> <span class="p">(</span><span class="s1">&#39;172.20.0.5&#39;</span><span class="p">,</span> <span class="mi">50100</span><span class="p">)</span>
<span class="n">cterm2_1</span>  <span class="o">|</span> <span class="n">ERROR</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">message</span><span class="p">:</span><span class="n">OMCI</span> <span class="n">message</span> <span class="n">length</span> <span class="p">(</span><span class="mi">80</span><span class="p">)</span> <span class="n">doesn</span><span class="s1">&#39;t match expected length (76)</span>
<span class="n">cterm2_1</span>  <span class="o">|</span> <span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">endpoint</span><span class="p">:</span><span class="mf">6368616e6</span><span class="n">e656c7465726d696e6174696f6e2e310000000000000000000000010054480a0100000004000100000000000000000000000000000000000000000000000000000000000000002800000000</span>
<span class="n">cterm2_1</span>  <span class="o">|</span> <span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">received</span> <span class="n">message</span> <span class="n">Set</span><span class="p">(</span><span class="n">attr_mask</span><span class="o">=</span><span class="mh">0x400</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;channeltermination.1&#39;</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">84</span><span class="p">,</span> <span class="n">values</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;battery_backup&#39;</span><span class="p">:</span> <span class="mi">1</span><span class="p">})</span> <span class="kn">from</span> <span class="p">(</span><span class="s1">&#39;172.20.0.5&#39;</span><span class="p">,</span> <span class="mi">50100</span><span class="p">)</span>
<span class="n">cterm2_1</span>  <span class="o">|</span> <span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="nb">set</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">attr_mask</span><span class="o">=</span><span class="mh">0x0400</span> <span class="n">values</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;battery_backup&#39;</span><span class="p">:</span> <span class="mi">1</span><span class="p">},</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span>
<span class="n">cterm2_1</span>  <span class="o">|</span> <span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">instance</span> <span class="p">{</span><span class="s1">&#39;me_inst&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">0</span><span class="p">,),</span> <span class="s1">&#39;vendor_id&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">1234</span><span class="p">,),</span> <span class="s1">&#39;version&#39;</span><span class="p">:</span> <span class="p">(</span><span class="s1">&#39;v2&#39;</span><span class="p">,),</span> <span class="s1">&#39;serial_number&#39;</span><span class="p">:</span> <span class="p">(</span><span class="s1">&#39;abcdefgh&#39;</span><span class="p">,</span> <span class="mi">5678</span><span class="p">),</span> <span class="s1">&#39;traffic_management&#39;</span><span class="p">:</span> <span class="p">(</span><span class="s1">&#39;priority-controlled&#39;</span><span class="p">,),</span> <span class="s1">&#39;battery_backup&#39;</span><span class="p">:</span> <span class="p">(</span><span class="kc">False</span><span class="p">,),</span> <span class="s1">&#39;admin_state&#39;</span><span class="p">:</span> <span class="p">(</span><span class="s1">&#39;unlock&#39;</span><span class="p">,)}</span>
<span class="n">cterm2_1</span>  <span class="o">|</span> <span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 6(battery_backup) = (1,)</span>
<span class="n">cterm2_1</span>  <span class="o">|</span> <span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">instance</span> <span class="p">{</span><span class="s1">&#39;me_inst&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">0</span><span class="p">,),</span> <span class="s1">&#39;mib_data_sync&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">0</span><span class="p">,)}</span>
<span class="n">cterm2_1</span>  <span class="o">|</span> <span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">updated</span><span class="p">:</span> <span class="n">MIB</span> <span class="mi">2</span><span class="p">(</span><span class="n">ONU</span> <span class="n">data</span><span class="p">)</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;me_inst&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">0</span><span class="p">,),</span> <span class="s1">&#39;mib_data_sync&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">1</span><span class="p">,)}</span>
<span class="n">cterm2_1</span>  <span class="o">|</span> <span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">endpoint</span><span class="p">:</span><span class="n">sent</span> <span class="mi">76</span> <span class="nb">bytes</span> <span class="n">to</span> <span class="p">(</span><span class="s1">&#39;172.20.0.5&#39;</span><span class="p">,</span> <span class="mi">50100</span><span class="p">)</span>
<span class="n">cterm2_1</span>  <span class="o">|</span> <span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">endpoint</span><span class="p">:</span><span class="mf">6368616e6</span><span class="n">e656c7465726d696e6174696f6e2e310000000000000000000000010054280a01000000000000000000000000000000000000000000000000000000000000000000000000000028</span>
<span class="n">cterm2_1</span>  <span class="o">|</span> <span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">sent</span> <span class="n">response</span> <span class="n">SetResponse</span><span class="p">(</span><span class="n">attr_exec_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;channeltermination.1&#39;</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">opt_attr_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">reason</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">84</span><span class="p">)</span> <span class="n">to</span> <span class="p">(</span><span class="s1">&#39;172.20.0.5&#39;</span><span class="p">,</span> <span class="mi">50100</span><span class="p">)</span>
<span class="n">polt_1</span>    <span class="o">|</span> <span class="p">[</span><span class="mi">1390570</span><span class="p">:</span> <span class="n">D</span> <span class="n">POLT</span>                <span class="p">]</span> <span class="n">bcm_tr451_polt_common</span><span class="o">.</span><span class="n">cc</span> <span class="mi">689</span><span class="o">|</span> <span class="n">Sent</span> <span class="n">OMCI</span> <span class="n">message</span> <span class="n">to</span> <span class="n">ONU</span> <span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span><span class="p">:</span><span class="mf">1.</span> <span class="mi">48</span> <span class="nb">bytes</span>
<span class="n">polt_1</span>    <span class="o">|</span> <span class="p">[</span><span class="mi">1390587</span><span class="p">:</span> <span class="n">D</span> <span class="n">POLT</span>                <span class="p">]</span> <span class="n">sim_tr451_polt_vendor</span><span class="o">.</span><span class="n">cc</span> <span class="mi">117</span><span class="o">|</span> <span class="n">RX</span> <span class="kn">from</span> <span class="nn">ONU</span><span class="p">:</span> <span class="n">cterm</span><span class="o">=</span><span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">1</span> <span class="n">length</span><span class="o">=</span><span class="mi">44</span> <span class="n">OMCI_HDR</span><span class="o">=</span><span class="mi">0054280</span><span class="n">a</span> <span class="mi">01000000</span>
<span class="n">vomci_1</span>   <span class="o">|</span> <span class="p">[</span><span class="mi">1390629</span><span class="p">:</span> <span class="n">D</span> <span class="n">POLT</span>                <span class="p">]</span> <span class="n">sim_tr451_polt_vendor</span><span class="o">.</span><span class="n">cc</span> <span class="mi">191</span><span class="o">|</span> <span class="n">TX</span> <span class="n">to</span> <span class="n">ONU</span><span class="p">:</span> <span class="n">cterm</span><span class="o">=</span><span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">1</span> <span class="n">length</span><span class="o">=</span><span class="mi">44</span> <span class="n">OMCI_HDR</span><span class="o">=</span><span class="mi">0054280</span><span class="n">a</span> <span class="mi">01000000</span>
<span class="n">vomci_1</span>   <span class="o">|</span> <span class="p">[</span><span class="mi">1390629</span><span class="p">:</span> <span class="n">D</span> <span class="n">POLT</span>                <span class="p">]</span> <span class="n">bcm_tr451_polt_common</span><span class="o">.</span><span class="n">cc</span> <span class="mi">689</span><span class="o">|</span> <span class="n">Sent</span> <span class="n">OMCI</span> <span class="n">message</span> <span class="n">to</span> <span class="n">ONU</span> <span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span><span class="p">:</span><span class="mf">1.</span> <span class="mi">44</span> <span class="nb">bytes</span>
</pre></div>
</div>
<p><strong>Shut down services (in services window):</strong></p>
<p>^C</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Gracefully</span> <span class="n">stopping</span><span class="o">...</span> <span class="p">(</span><span class="n">press</span> <span class="n">Ctrl</span><span class="o">+</span><span class="n">C</span> <span class="n">again</span> <span class="n">to</span> <span class="n">force</span><span class="p">)</span>
<span class="n">Stopping</span> <span class="n">onusim_vomci_1</span>  <span class="o">...</span> <span class="n">done</span>
<span class="n">Stopping</span> <span class="n">onusim_polt_1</span>   <span class="o">...</span> <span class="n">done</span>
<span class="n">Stopping</span> <span class="n">onusim_cterm1_1</span> <span class="o">...</span> <span class="n">done</span>
<span class="n">Stopping</span> <span class="n">onusim_cterm2_1</span> <span class="o">...</span> <span class="n">done</span>
<span class="n">Stopping</span> <span class="n">onusim_cterm_1</span>  <span class="o">...</span> <span class="n">done</span>
<span class="o">%</span>
</pre></div>
</div>
</div>
<div class="section" id="with-tr451_polt_simulator-old-not-using-docker-compose">
<h3>With tr451_polt_simulator: old (not using docker-compose)<a class="headerlink" href="#with-tr451_polt_simulator-old-not-using-docker-compose" title="Permalink to this headline">¶</a></h3>
<p><a class="reference external" href="https://issues.broadband-forum.org/browse/OBBAA-237?focusedCommentId=70976&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-70976">OBBAA-237</a> explains how a second <code class="docutils literal notranslate"><span class="pre">tr451_polt_simulator</span></code> instance can be used to inject test OMCI messages. Here&rsquo;s how I tried it.</p>
<p>I defined these aliases:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">alias</span> <span class="n">onu</span><span class="o">=</span><span class="s1">&#39;docker container run -it --name obbaa-onu-simulator --rm -v $APPROOT:/app -w /opt/obbaa-polt-simulator/build/fs broadbandforum/obbaa-onu-simulator:latest&#39;</span>
<span class="o">%</span> <span class="n">alias</span> <span class="n">onue</span><span class="o">=</span><span class="s1">&#39;docker container exec -it obbaa-onu-simulator bash&#39;</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">onu</span></code> runs the container and <code class="docutils literal notranslate"><span class="pre">onue</span></code> (&ldquo;ONU exec&rdquo;) execs bash in the running container (so effectively logs into it).</p>
<p>I copied the certificates (attached to OBBAA-237) to <code class="docutils literal notranslate"><span class="pre">./share</span></code>, so they are available at <code class="docutils literal notranslate"><span class="pre">/app/share</span></code> in the container.</p>
<p>I followed the instructions in <code class="docutils literal notranslate"><span class="pre">obbaa-polt-simulator/README.md</span></code> and OBBAA-237.</p>
<p>Note:</p>
<ol class="simple">
<li><p>The README says to run <code class="docutils literal notranslate"><span class="pre">bin/start_netconf_server.sh</span></code> but I assume that&rsquo;s a typo because that script doesn&rsquo;t exist</p></li>
</ol>
<p><strong>Window 1: ONU simulator</strong></p>
<p>The simulator is started with the same port, cterm_name and onu_id that Igor uses below.</p>
<p>Command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">onusim</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">n</span> <span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span> <span class="o">-</span><span class="n">i</span> <span class="mi">1</span> <span class="o">-</span><span class="n">p</span> <span class="mi">50000</span> <span class="o">-</span><span class="n">l</span> <span class="mi">2</span>
</pre></div>
</div>
<p>Output:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">args</span> <span class="n">Namespace</span><span class="p">(</span><span class="n">address</span><span class="o">=</span><span class="s1">&#39;0.0.0.0&#39;</span><span class="p">,</span> <span class="n">ctermname</span><span class="o">=</span><span class="s1">&#39;channeltermination.1&#39;</span><span class="p">,</span>
<span class="n">dumpfile</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">loglevel</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">onuidfirst</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">onuidlast</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">50000</span><span class="p">)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">server</span> <span class="n">Endpoint</span><span class="p">(</span><span class="n">address</span><span class="o">=</span><span class="p">(</span><span class="s1">&#39;0.0.0.0&#39;</span><span class="p">,</span> <span class="mi">50000</span><span class="p">),</span> <span class="n">is_server</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;channeltermination.1&#39;</span><span class="p">,</span> <span class="n">onu_id_range</span><span class="o">=</span><span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="n">tr451</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dumpfd</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span>
</pre></div>
</div>
<p><strong>Window 2: pOLT simulator #1 (pOLT)</strong></p>
<p>Command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">start_tr451_polt</span><span class="o">.</span><span class="n">sh</span> <span class="o">-</span><span class="n">d</span>
</pre></div>
</div>
<p>Script (<code class="docutils literal notranslate"><span class="pre">./share/polt.cli</span></code>):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">/</span><span class="n">po</span><span class="o">/</span><span class="nb">set</span> <span class="n">client_server</span><span class="o">=</span><span class="n">server</span> <span class="n">enable</span><span class="o">=</span><span class="n">yes</span>
<span class="o">/</span><span class="n">po</span><span class="o">/</span><span class="n">au</span> <span class="n">priv_key</span><span class="o">=/</span><span class="n">app</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">polt_privatekey</span><span class="o">.</span><span class="n">pem</span> <span class="n">local_cert</span><span class="o">=/</span><span class="n">app</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">polt</span><span class="o">.</span><span class="n">cer</span> <span class="n">peer_cert</span><span class="o">=/</span><span class="n">app</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">vomci</span><span class="o">.</span><span class="n">cer</span>
<span class="o">/</span><span class="n">po</span><span class="o">/</span><span class="n">en</span> <span class="n">client_server</span><span class="o">=</span><span class="n">server</span> <span class="n">name</span><span class="o">=</span><span class="n">polt</span> <span class="n">port</span><span class="o">=</span><span class="mi">8433</span>
<span class="o">/</span><span class="n">polt</span><span class="o">/</span><span class="nb">filter</span> <span class="n">client_server</span><span class="o">=</span><span class="n">server</span> <span class="n">name</span><span class="o">=</span><span class="n">filt1</span> <span class="n">priority</span><span class="o">=</span><span class="mi">100</span> <span class="n">ep_name</span><span class="o">=</span><span class="n">vomci1</span> <span class="n">Type</span><span class="o">=</span><span class="nb">any</span>
<span class="o">/</span><span class="n">po</span><span class="o">/</span><span class="n">onu</span> <span class="n">channel_term</span><span class="o">=</span><span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">1</span> <span class="n">serial_vendor_id</span><span class="o">=</span><span class="n">BRCM</span> <span class="n">serial_vendor_specific</span><span class="o">=</span><span class="mi">00000001</span>
</pre></div>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">/</span><span class="n">po</span><span class="o">/</span><span class="n">rx_mode</span> <span class="n">mode</span><span class="o">=</span><span class="n">onu_sim</span> <span class="n">onu_sim_ip</span><span class="o">=</span><span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span> <span class="n">onu_sim_port</span><span class="o">=</span><span class="mi">50000</span> <span class="n">local_udp_port</span><span class="o">=</span><span class="mi">50100</span>
</pre></div>
</div>
<p><strong>Window 3: pOLT simulator #2 (vOMCI)</strong></p>
<p>Command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">start_tr451_polt</span><span class="o">.</span><span class="n">sh</span> <span class="o">-</span><span class="n">d</span>
</pre></div>
</div>
<p>Script (<code class="docutils literal notranslate"><span class="pre">./share/vomci.cli</span></code>):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">/</span><span class="n">po</span><span class="o">/</span><span class="n">au</span> <span class="n">priv_key</span><span class="o">=/</span><span class="n">app</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">vomci_privatekey</span><span class="o">.</span><span class="n">pem</span> <span class="n">local_cert</span><span class="o">=/</span><span class="n">app</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">vomci</span><span class="o">.</span><span class="n">cer</span> <span class="n">peer_cert</span><span class="o">=/</span><span class="n">app</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">polt</span><span class="o">.</span><span class="n">cer</span>
<span class="o">/</span><span class="n">po</span><span class="o">/</span><span class="nb">set</span> <span class="n">client_server</span><span class="o">=</span><span class="n">client</span> <span class="n">enable</span><span class="o">=</span><span class="n">yes</span>
<span class="o">/</span><span class="n">po</span><span class="o">/</span><span class="n">end</span> <span class="n">client_server</span><span class="o">=</span><span class="n">client</span> <span class="n">name</span><span class="o">=</span><span class="n">polt1</span> <span class="n">port</span><span class="o">=</span><span class="mi">8433</span> <span class="n">host</span><span class="o">=</span><span class="n">localhost</span>
<span class="o">/</span><span class="n">po</span><span class="o">/</span><span class="nb">filter</span> <span class="n">client_server</span><span class="o">=</span><span class="n">client</span> <span class="n">name</span><span class="o">=</span><span class="n">filt1</span> <span class="n">priority</span><span class="o">=</span><span class="mi">100</span> <span class="n">ep_name</span><span class="o">=</span><span class="n">polt1</span> <span class="n">Type</span><span class="o">=</span><span class="nb">any</span>
<span class="o">/</span><span class="n">po</span><span class="o">/</span><span class="n">onu</span> <span class="n">channel_term</span><span class="o">=</span><span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">1</span> <span class="n">serial_vendor_id</span><span class="o">=</span><span class="n">BRCM</span> <span class="n">serial_vendor_specific</span><span class="o">=</span><span class="mi">00000001</span>
</pre></div>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">/</span><span class="n">po</span><span class="o">/</span><span class="n">inject</span> <span class="n">channeltermination</span><span class="o">.</span><span class="mi">1</span> <span class="mi">1</span> <span class="mi">0054480</span><span class="n">a01000000040001000000000000000000000000000000000000000000000000000000000000000028</span>
</pre></div>
</div>
<p>Window 1: ONU simulator:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">endpoint</span><span class="p">:</span><span class="n">received</span> <span class="mi">80</span><span class="o">/</span><span class="mi">2048</span> <span class="nb">bytes</span> <span class="kn">from</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">50100</span><span class="p">)</span>
<span class="n">ERROR</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">message</span><span class="p">:</span><span class="n">OMCI</span> <span class="n">message</span> <span class="n">length</span> <span class="p">(</span><span class="mi">80</span><span class="p">)</span> <span class="n">doesn</span><span class="s1">&#39;t match expected length (76)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">endpoint</span><span class="p">:</span><span class="mf">6368616e6</span><span class="n">e656c7465726d696e6174696f6e2e310000000000000000000000010054480a0100000004000100000000000000000000000000000000000000000000000000000000000000002800000000</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">received</span> <span class="n">message</span> <span class="n">Set</span><span class="p">(</span><span class="n">attr_mask</span><span class="o">=</span><span class="mh">0x400</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;channeltermination.1&#39;</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">84</span><span class="p">,</span> <span class="n">values</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;battery_backup&#39;</span><span class="p">:</span> <span class="mi">1</span><span class="p">})</span> <span class="kn">from</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">50100</span><span class="p">)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="nb">set</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">attr_mask</span><span class="o">=</span><span class="mh">0x0400</span> <span class="n">values</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;battery_backup&#39;</span><span class="p">:</span> <span class="mi">1</span><span class="p">},</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">instance</span> <span class="p">{</span><span class="s1">&#39;me_inst&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">0</span><span class="p">,),</span> <span class="s1">&#39;vendor_id&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">1234</span><span class="p">,),</span> <span class="s1">&#39;version&#39;</span><span class="p">:</span> <span class="p">(</span><span class="s1">&#39;v2&#39;</span><span class="p">,),</span> <span class="s1">&#39;serial_number&#39;</span><span class="p">:</span> <span class="p">(</span><span class="s1">&#39;abcdefgh&#39;</span><span class="p">,</span> <span class="mi">5678</span><span class="p">),</span> <span class="s1">&#39;traffic_management&#39;</span><span class="p">:</span> <span class="p">(</span><span class="s1">&#39;priority-controlled&#39;</span><span class="p">,),</span> <span class="s1">&#39;battery_backup&#39;</span><span class="p">:</span> <span class="p">(</span><span class="kc">False</span><span class="p">,),</span> <span class="s1">&#39;admin_state&#39;</span><span class="p">:</span> <span class="p">(</span><span class="s1">&#39;unlock&#39;</span><span class="p">,)}</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">MIB</span> <span class="mi">256</span><span class="p">(</span><span class="n">ONU</span><span class="o">-</span><span class="n">G</span><span class="p">)</span> <span class="c1">#0 6(battery_backup) = (1,)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">instance</span> <span class="p">{</span><span class="s1">&#39;me_inst&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">0</span><span class="p">,),</span> <span class="s1">&#39;mib_data_sync&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">0</span><span class="p">,)}</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">database</span><span class="p">:</span><span class="n">updated</span><span class="p">:</span> <span class="n">MIB</span> <span class="mi">2</span><span class="p">(</span><span class="n">ONU</span> <span class="n">data</span><span class="p">)</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;me_inst&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">0</span><span class="p">,),</span> <span class="s1">&#39;mib_data_sync&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">1</span><span class="p">,)}</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">endpoint</span><span class="p">:</span><span class="n">sent</span> <span class="mi">76</span> <span class="nb">bytes</span> <span class="n">to</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">50100</span><span class="p">)</span>
<span class="n">DEBUG</span><span class="p">:</span><span class="n">onusim</span><span class="o">.</span><span class="n">endpoint</span><span class="p">:</span><span class="mf">6368616e6</span><span class="n">e656c7465726d696e6174696f6e2e310000000000000000000000010054280a01000000000000000000000000000000000000000000000000000000000000000000000000000028</span>
<span class="n">INFO</span><span class="p">:</span><span class="n">onusim</span><span class="p">:</span><span class="n">sent</span> <span class="n">response</span> <span class="n">SetResponse</span><span class="p">(</span><span class="n">attr_exec_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">cterm_name</span><span class="o">=</span><span class="s1">&#39;channeltermination.1&#39;</span><span class="p">,</span> <span class="n">extended</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">me_class</span><span class="o">=</span><span class="mi">256</span><span class="p">,</span> <span class="n">me_inst</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">onu_id</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">opt_attr_mask</span><span class="o">=</span><span class="mh">0x0</span><span class="p">,</span> <span class="n">reason</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">tci</span><span class="o">=</span><span class="mi">84</span><span class="p">)</span> <span class="n">to</span> <span class="p">(</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">,</span> <span class="mi">50100</span><span class="p">)</span>
</pre></div>
</div>
<p><!-- links --></p>
</div>
</div>
</div>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">1. Introduction</a><ul>
<li><a class="reference internal" href="#installation">1.1. Installation</a></li>
<li><a class="reference internal" href="#onu-simulation-server">1.2. ONU simulation server</a></li>
<li><a class="reference internal" href="#onu-test-client">1.3. ONU test client</a></li>
<li><a class="reference internal" href="#examples">1.4. Examples</a><ul>
<li><a class="reference internal" href="#get">Get</a></li>
<li><a class="reference internal" href="#omci_dump_decoder">omci_dump_decoder</a></li>
</ul>
</li>
<li><a class="reference internal" href="#docker">1.5. Docker</a><ul>
<li><a class="reference internal" href="#docker-server-host-client">Docker server, host client</a></li>
<li><a class="reference internal" href="#host-server-docker-client">Host server, Docker client</a></li>
<li><a class="reference internal" href="#docker-server-docker-client">Docker server, Docker client</a></li>
<li><a class="reference internal" href="#with-tr451_polt_simulator-new-using-docker-compose">With tr451_polt_simulator: new (using docker-compose)</a></li>
<li><a class="reference internal" href="#with-tr451_polt_simulator-old-not-using-docker-compose">With tr451_polt_simulator: old (not using docker-compose)</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="../index.html"
                        title="previous chapter">ONU simulator and test client</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="extensions.html"
                        title="next chapter"><span class="section-number">2. </span>Extensions</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/usage/introduction.md.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="extensions.html" title="2. Extensions"
             >next</a> |</li>
        <li class="right" >
          <a href="../index.html" title="ONU simulator and test client"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">onusim  documentation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href=""><span class="section-number">1. </span>Introduction</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2020, Broadband Forum.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.1.0+.
    </div>
  </body>
</html>